package cn.xhjava.crm.workbench.mapper;

import cn.xhjava.crm.workbench.domain.FunnelVO;
import cn.xhjava.crm.workbench.domain.Tran;

import java.util.List;
import java.util.Map;

public interface TranMapper {

    int deleteByPrimaryKey(String id) throws Exception;

    int insert(Tran record) throws Exception;

    int insertSelective(Tran record) throws Exception;

    Tran selectByPrimaryKey(String id) throws Exception;

    int updateByPrimaryKeySelective(Tran record) throws Exception;

    int updateByPrimaryKey(Tran record) throws Exception;

    List<Tran> selectForPage(Map<String, Object> map) throws Exception;

    int selectCountForPage(Map<String, Object> map) throws Exception;

    Tran selectDetailById(String id) throws Exception;

    List<Tran> selectTransactionListByContactsId(String id) throws Exception;

    List<Tran> selectTransactionListByCustomerId(String id) throws Exception;

    /**
     * 查询交易表中各个阶段的数据量
     *
     * @return
     */
    List<FunnelVO> selectCountOfTranGroupByStage() throws Exception;

    List<FunnelVO> queryMonryCountGroupByCreateTime() throws Exception;
}